﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using DAL;

namespace BLL
{
    public class PhaseService
    {
        PhasesDAL phaseDAL = new PhasesDAL();

        public void CreatePhase(BoPhases phase)
        {
            phaseDAL.Insert(phase);
        }

        public void UpdatePhase(BoPhases phase)
        {
            phaseDAL.Update(phase);
        }

        public void DeletePhase(BoPhases phase)
        {
            phaseDAL.Delete(phase.PHA_ID);
        }

        public BoPhases getPhase(string id)
        {
            return phaseDAL.GetModel(id);
        }

        public IList<BoPhases> getAllPhases()
        {
            return phaseDAL.GetAllPhases();
        }
        /// <summary>
        /// 得到分页的数据列表
        /// </summary>
        /// <param name="orderCon">排序条件</param>
        /// <param name="sqlCon">查询条件</param>
        /// <param name="pagesize">每页显示大小</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="records">返回查询到的记录</param>
        /// <returns>返回对象列表</returns>
        public IList<BoPhases> getPagePhases(string sqlCon, string orderCon, int pagesize, int pageIndex, out int records)
        {
            return phaseDAL.getPagePhases(sqlCon, orderCon, pagesize, pageIndex, out records);
        }
    }
}
